﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using MarketOnlineBUS;
using MarketOnlineDTO;

public partial class Category : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Request.QueryString["catid"] != null)
        {
            string catid = Request.QueryString["catid"].ToString();
            int maloai = Convert.ToInt32(catid);
            LoadSanPhamTheoLoai(maloai);
        }
        else
        {
            LoadSanPhamTheoLoai(1);
        }

    }

    void LoadSanPhamTheoLoai(int MaLoaiSP)
    {
        List<SanPhamDTO> lst = new List<SanPhamDTO>();
        lst = new SanPhamBUS().LaySanPhamTheoLoai(MaLoaiSP,0);
        listProduct.DataSource = lst;
        listProduct.DataBind();
    }
}